﻿namespace SortAndAvg
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Random random = new Random();
            int[] numbers = Enumerable.Range(0, 100).Select(i => random.Next(0, 1001)).ToArray();

            var sortedNumbers = numbers.OrderByDescending(n => n);
            int sum = sortedNumbers.Sum();
            double average = sortedNumbers.Average();

            Console.WriteLine($"排序后的整数: {string.Join(",", sortedNumbers)}");
            Console.WriteLine($"总和: {sum}");
            Console.WriteLine($"平均值: {average}");
        }
    }
}